<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">

    <ui:composition>

        <p:dialog id="UserCreateDlg" widgetVar="UserCreateDialog" modal="true" resizable="false" appendToBody="true" header="#{bundle.CreateUserTitle}" closeOnEscape="true">

            <h:form id="UserCreateForm">

                <h:panelGroup id="display">
                    <p:panelGrid columns="2">

                        <p:outputLabel value="#{bundle.CreateUserLabel_userId}" for="userId" />
                        <p:inputText id="userId" value="#{userController.selected.userId}" title="#{bundle.CreateUserTitle_userId}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_userId}"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_email}" for="email" />
                        <p:inputText id="email" value="#{userController.selected.email}" title="#{bundle.CreateUserTitle_email}" size="255" maxlength="255"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_password}" for="password" />
                        <p:inputText id="password" value="#{userController.selected.password}" title="#{bundle.CreateUserTitle_password}" size="32" maxlength="32"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_firstName}" for="firstName" />
                        <p:inputText id="firstName" value="#{userController.selected.firstName}" title="#{bundle.CreateUserTitle_firstName}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_lastName}" for="lastName" />
                        <p:inputText id="lastName" value="#{userController.selected.lastName}" title="#{bundle.CreateUserTitle_lastName}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_gender}" for="gender" />
                        <p:inputText id="gender" value="#{userController.selected.gender}" title="#{bundle.CreateUserTitle_gender}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_address}" for="address" />
                        <p:inputText id="address" value="#{userController.selected.address}" title="#{bundle.CreateUserTitle_address}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_country}" for="country" />
                        <p:inputText id="country" value="#{userController.selected.country}" title="#{bundle.CreateUserTitle_country}" size="45" maxlength="45"/>

                        <p:outputLabel value="#{bundle.CreateUserLabel_role}" for="role" />
                        <p:inputText id="role" value="#{userController.selected.role}" title="#{bundle.CreateUserTitle_role}" required="true" requiredMessage="#{bundle.CreateUserRequiredMessage_role}" size="45" maxlength="45"/>
                    </p:panelGrid>
                    <p:commandButton actionListener="#{userController.saveNew}" value="#{bundle.Save}" update="display,:UserListForm:datalist,:growl" oncomplete="handleSubmit(xhr,status,args,UserCreateDialog);"/>
                    <p:commandButton value="#{bundle.Cancel}" onclick="UserCreateDialog.hide()"/>
                </h:panelGroup>

            </h:form>

        </p:dialog>

    </ui:composition>

</html>
